<div ng-include="sys_html('layout/order/_header')"></div>
<style>
.modal-open {
	overflow:hidden
}
.modal {
	position:fixed;
	top:0;
	right:0;
	bottom:0;
	left:0;
	z-index:1050;
	display:none;
	overflow:hidden;
	-webkit-overflow-scrolling:touch;
	outline:0
}
.modal.fade .modal-dialog {
	-webkit-transition:-webkit-transform .3s ease-out;
	-o-transition:-o-transform .3s ease-out;
	transition:transform .3s ease-out;
	-webkit-transform:translate(0,-25%);
	-ms-transform:translate(0,-25%);
	-o-transform:translate(0,-25%);
	transform:translate(0,-25%)
}
.modal.in .modal-dialog {
	-webkit-transform:translate(0,0);
	-ms-transform:translate(0,0);
	-o-transform:translate(0,0);
	transform:translate(0,0)
}
.modal-open .modal {
	overflow-x:hidden;
	overflow-y:auto
}
.modal-dialog {
	position:relative;
	width:auto;
	margin:10px
}
.modal-content {
	position:relative;
	background-color:#fff;
	-webkit-background-clip:padding-box;
	background-clip:padding-box;
	border:1px solid #999;
	border:1px solid rgba(0,0,0,.2);
	border-radius:6px;
	outline:0;
	-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);
	box-shadow:0 3px 9px rgba(0,0,0,.5)
}
.modal-header {
	padding:15px;
	border-bottom:1px solid #e5e5e5
}
.modal-header .close {
	margin-top:-2px
}
.modal-title {
	margin:0;
	line-height:1.42857143
}
.modal-body {
	position:relative;
	padding:15px
}
.modal-footer {
	padding:15px;
	text-align:right;
	border-top:1px solid #e5e5e5
}
.modal-footer .btn+.btn {
	margin-bottom:0;
	margin-left:5px
}
.modal-footer .btn-group .btn+.btn {
	margin-left:-1px
}
.modal-footer .btn-block+.btn-block {
	margin-left:0
}
.modal-scrollbar-measure {
	position:absolute;
	top:-9999px;
	width:50px;
	height:50px;
	overflow:scroll
}
@media (min-width:768px) {
	.modal-dialog {
	width:600px;
	margin:30px auto
}
.modal-content {
	-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);
	box-shadow:0 5px 15px rgba(0,0,0,.5)
}
.modal-sm {
	width:300px
}
}@media (min-width:992px) {
	.modal-lg {
	width:900px
}
}
</style>
<div class="ncc-wrapper" id="loadhtml" style="display:none">
    <div class="ncc-main">
        <div class="ncc-title">
            <h3>Fill in the check the shopping information</h3>
            <h5>Please check carefully fill in the information such as receiving, invoice, to ensure that the logistics delivery timely and accurate delivery.</h5>
        </div>
        <div class="ncc-receipt-info">
            <div class='fui-content'>
				 <div ng-if="pagedata.post.sendtype ==1 && !pagedata.item.address" class="fui-list-group" id='addressInfo'>
                    <a href="javascript:;" onclick="$('#ediaaddress').modal();" data-nocache="true">							<div class="text no-address">
                                <i class="icon icon-add"></i> Add a shipping address
                            </div>
					</a>
				</div>
				 <div ng-if="pagedata.post.sendtype ==1 && pagedata.item.address" class="fui-list-group" id='addressInfo'>
					<a class="fui-list" href="javascript:;" ng-click="access_json('/member.address/')">
                        <div class="fui-list-media">
                            <i class="icon icon-map"></i>
                        </div>
                        <div class="fui-list-inner">							<div ng-if="pagedata.item.address" class="title has-address">
                                <span class='realname'>{{pagedata.item.address.name || 'anonymous'}}</span> <span class='mobile'>{{pagedata.item.address.mobile}}</span>
                            </div>
                            <div ng-if="pagedata.item.address" class="text has-address">
                                <span class='address'>{{pagedata.item.address.pcd.province}} {{pagedata.item.address.pcd.city}} {{pagedata.item.address.pcd.district}} {{pagedata.item.address.address}}</span>
                            </div>
                        </div>
					</a>
                </div>
                <!--自提点选择-->
                <div ng-if="pagedata.post.sendtype ==2" class="fui-list-group" id="carrierInfo">
                    <a class="fui-list" href="javascript:;" onclick="$('#showstores').modal();">
                        <div class="fui-list-media">
                            <i class="icon icon-dianpu"></i>
                        </div>
                        <div class="fui-list-inner">
                            <div class="title"><span class='storename'>{{pagedata.selectstore.title}}</span></div>
                            <div class="subtitle"><span class='realname'>{{pagedata.selectstore.realname}}</span> <span class='mobile' id="carrierInfo_mobile">{{pagedata.selectstore.mobile}}</span>
                            </div>
                            <div class="text"><span class='address'>{{pagedata.selectstore.pcd.province}} {{pagedata.selectstore.pcd.city}} {{pagedata.selectstore.pcd.district}} {{pagedata.selectstore.address}}</span></div>
                        </div>
                        <div class="fui-list-angle">
                            <div class="angle"></div>
                        </div>
                    </a>
                </div>                <!--联系填写-->                <div ng-if="pagedata.post.sendtype ==2" class="fui-cell-group sm" id="memberInfo">                    <div class="fui-cell">                        <div class="fui-cell-label sm">The contact</div>                        <div class="fui-cell-info">
						<input type="text" placeholder="Please enter the contact" name='carrier_realname' class="fui-input" ng-model="pagedata.post.realname" value="{{pagedata.post.realname}}"/>
						</div>                    </div>                    <div class="fui-cell">                        <div class="fui-cell-label sm">Contact phone</div>                        <div class="fui-cell-info">
						<input type="tel" placeholder="Please enter the phone number" name='carrier_mobile' class="fui-input" ng-model="pagedata.post.mobile" value="{{pagedata.post.mobile}}"/>
						</div>                    </div>                </div>            </div>
         
        </div>
        <div class="ncc-receipt-info">
            <div class="fui-list-group">
                <div class="fui-list-group-title"><i class="icon icon-shop"></i>{{pagedata.pc_set.pc_title}}</div>					<div ng-repeat="g in pagedata.order.list">
                    <div class="fui-list goods-item">
                        <div class="fui-list-media">
                            <a href="javascript:;" ng-click="access_json('jy_weishop_en/goods.detail//id='+g.goodsid)">
                                <img ng-src="{{tomedia(g.image)}}" class="round" style="height:2.5rem">
                            </a>
                        </div>
                        <div class="fui-list-inner">
                            <a href="javascript:;" ng-click="access_json('jy_weishop_en/goods.detail//id='+g.goodsid)">
                                <div class="text">
                                    {{g.title}}
                                </div>
                                    <div class="text">
                                        {{g.optiontitle || ''}} <span class="num bold">{{pagedata.order.weight || '0.210'}}kg x {{g.total}}</span>
                                    </div>
                            </a>
                        </div>
                        <div class='fui-list-angle'>
                            <span class="price ">$<span class='marketprice'>{{g.price}}</span></span>
							<span class="total">x {{g.total}}</span>
                        </div>                       </div>
                    </div>
                <div class='fui-cell-group'>
                    <div class="fui-cell">
                        <div class="fui-cell-info" style="text-align: right;">A total of <span id='goodscount' class='text-danger'>{{pagedata.order.total}}</span> item A combined：<span class="text-danger">$<span class='goodsprice'>{{pagedata.order.total_price}}</soan></span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
            <div ng-if="pagedata.deductcredit>0" class="ncc-receipt-info">
                <div class="fui-cell">
                    <div class="fui-cell-label" style="width: auto;"><span id="deductcredit_info" class='text-danger'>{{pagedata.deductcredit}}</span>Integral deductible <span id="deductcredit_money" class='text-danger'>${{deductmoney}}</span></div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">
					<input id="deductcredit" type="checkbox" class="fui-switch fui-switch-small fui-switch-success pull-right">
                    </div>
                </div>
            </div>
            <div ng-if="pagedata.deductcredit2>0" class="ncc-receipt-info">
                <div class="fui-cell">
                    <div class="fui-cell-label" style="width: auto;">Integral deductible <span id='deductcredit2_money' class="text-danger">${{pagedata.deductcredit2}}</span>
                    </div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cellfui-cell-remark noremarkinfo">
					<input id="deductcredit2" type="checkbox" class="fui-switch fui-switch-small fui-switch-success pull-right">
                    </div>
                </div>
            </div>
            <div ng-if="!pagedata.order_formInfo" class="ncc-receipt-info fui-cell-group sm ">
                <div class="fui-cell">
                    <div class="fui-cell-info">
					<input type="text" class="fui-input" id='remark' placeholder="Optional: buyers message (less than 50 words)" maxlength="50"></div>
                </div>
            </div>
        <div class="fui-cell-group sm">
            <input type="hidden" id="weight" name='weight' value="{{pagedata.total_weight}}"/>
            <div class="fui-cell">
                <div class="fui-cell-label">Merchandise subtotal</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">$<span class='goodsprice'>{{pagedata.order.total_price}}</span>
                 </div>
            </div>
            <div class="fui-cell">
                <div class="fui-cell-label">The freight</div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">$<span class='dispatchprice'>{{pagedata.order.dispatchprice || '0.00'}}</span></div>
            </div>
                <div ng-if="pagedata.order.level_de_price>0" class="fui-cell">
                    <div class="fui-cell-label" style='width:auto'>Member discount</div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">-$<span id='discountprice' class='discountprice'>{{pagedata.order.level_de_price}}</span>
                    </div>
                </div>
                <div ng-if="pagedata.isdiscountprice>0" class="fui-cell">
                    <div class="fui-cell-label" style='width:auto'>Promotional offers</div>
                    <div class="fui-cell-info"></div>
                    <div class="fui-cell-remark noremark">-$<span id='isdiscountprice' class='isdiscountprice'>{{pagedata.isdiscountprice}}</span>
                    </div>
                </div>
            <div ng-if="pagedata.saleset.showenough" class="fui-cell" id="deductenough">                <div class="fui-cell-label" style='width:auto'>Mall is single <span id="deductenough_enough" class='text-danger'>${{pagedata.saleset.enoughmoney}}</span>
                   knock
                </div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">-$<span id='deductenough_money'>{{ifelse(pagedata.saleset.showenough,pagedata.saleset.enoughdeduct,'')}}</span>
                </div>
            </div>
            <div ng-if="pagedata.merch_saleset.merch_showenough" class="fui-cell" id="merch_deductenough">                <div class="fui-cell-label" style='width:auto'>Merchants single full <span id="merch_deductenough_enough" class='text-danger'>${{pagedata.merch_saleset.merch_enoughmoney}}</span> knock</div>                <div class="fui-cell-info"></div>                <div class="fui-cell-remark noremark">-$<span id='merch_deductenough_money'>{{ifelse(pagedata.merch_saleset.merch_showenough,pagedata.merch_saleset.merch_enoughdeduct,'')}}</span>
                </div>
            </div>
            <div class="fui-cell" id='coupondeduct_div' style='display:none'>
                <div class="fui-cell-label" style='width:auto' id='coupondeduct_text'></div>
                <div class="fui-cell-info"></div>
                <div class="fui-cell-remark noremark">-$<span id="coupondeduct_money">0</span></div>
            </div>
            <div class="fui-navbar order-create-checkout" style="position:relative;border:1px solid #D9D9D9;margin-top:0.8rem;">
                <a href="javascript:;" class="nav-item total">
                    <p>Need to pay：<span class="text-danger ">$<span  class="totalprice">{{pagedata.order.endprice}}</span></span>
                    </p>
                </a>
                <a ng-if="!pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="pagedata.pay_submit(pagedata.post,'post')">Immediate payment</a>
				 <a ng-if="pagedata.order_id" href="javascript:;" class="nav-item btn btn-danger buybtn" ng-click="access_json('/order.detail//id='+pagedata.order_id+'&fromcreate=1')">To view the order</a>
            </div>
        </div>
</div>
<div id="ediaaddress"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:800px;top:20%;max-height:480px">
		<div class="modal-content">
			<div class="modal-body" style="padding:10px;">
					<div class='fui-cell-group'>
                        <div class='fui-cell'>
                            <div class='fui-cell-label'>Realname</div>
                            <div class='fui-cell-info'><input type="text" id='realname'  name='name' ng-model="pagedata.address.name" placeholder="recipient" class="fui-input"/></div>
                        </div>
                        <div class='fui-cell'>
                            <div class='fui-cell-label'>Mobile</div>
                            <div class='fui-cell-info'><input type="tel" id='mobile' name='mobile' ng-model="pagedata.address.mobile" placeholder="mobile"  class="fui-input"/></div>
                        </div>
						<div class='fui-cell'>
                            <div class='fui-cell-label'>Country/Region</div>
                            <div class='fui-cell-info'>
								<select style="padding:0.3rem" name="province" ng-model="pagedata.address.pcd.province">
									<option ng-repeat="q in pagedata.countries" value="{{q.en_title}}">{{q.en_title}}</option>
								</select>
							</div>
                        </div>
						<div class='fui-cell'>
                            <div class='fui-cell-label'>City</div>
                            <div class='fui-cell-info'><input type="text" ng-model="pagedata.address.pcd.city" placeholder="city" class="fui-input"/></div>
                        </div>
						<div class='fui-cell'>
                            <div class='fui-cell-label'>District</div>
                            <div class='fui-cell-info'><input type="text" ng-model="pagedata.address.pcd.district" placeholder="district" class="fui-input"/></div>
                        </div>
                        <div class='fui-cell'>
                            <div class='fui-cell-label'>Detailed address</div>
                            <div class='fui-cell-info'><input type="text" id='address' name='address' ng-model="pagedata.address.address" placeholder='Street, building brand, etc'  class="fui-input"/></div>
                        </div>
                    </div>
                    <a id="btn-submit" ng-click="pagedata.add_address();" class='external btn btn-danger block'>Save the address</a>
			</div>
			</div>
		</div>
</div><div ng-include="sys_html('layout/order/_footer')"></div>
<div ng-include="sys_html('common/_pay_en',true)"></div>
<script language='javascript'>
scope.pagedata.pay_submit=function(post,post_url){
	scope.post_json(post_url,post,function(result){
		scope.pagedata.order_id=result.order_id;
		scope.$evalAsync();
		scope.tool.pay(result.pay_id,function(res){
		},'',scope.pagedata.forward_url,'','','',{'pay_en':'en'});
	});
}
scope.pagedata.add_address=function(){
	scope.pagedata.address.res=1
	if(scope.pagedata.isaddaddress==1){
		scope.pagedata.address.id=0;
	}
	scope.pagedata.post.address=scope.pagedata.address;
	scope.pagedata.item.address=scope.pagedata.address;
	scope.post_json('/member.address/save//',scope.pagedata.address,function(res){
		scope.pagedata.post.addressid =res;
	});
}
scope.pagedata.selectstores=function(id){
	scope.pagedata.post.storeid = id;
	$('#showstores').modal('hide');
}
</script>